<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第一周测试</title>
    <link rel="stylesheet" href="__CSS__/answer.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        .exam{
            border-top: 1px solid #a57e7e;
            margin: 20px 20px;
        }
        #paperName{
            text-align: center;
        }
        .exam h4{
            margin: 10px 0;
            font-weight: 400;
        }
        .answer{
            padding-left: 10px;
            font: bold;
            color: rgb(72, 49, 162);
            font-weight: 600;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="nav">
            <ul>
                <a href="{:url('Answer/index')}" class="subNav">
                    <li>测试</li>
                </a>
                <a href="{:url('Answer/score')}" class="subNav">
                    <li>查看结果</li>
                </a>
                <a href="" class="subNav">
                    <li>当前身份</li>
                </a>
                <a href="{:url('Answer/lssue')}">
                    <li>发布试题</li>
                </a>
            </ul>
        </div>
        <div class="content">
            <h2 id="paperName">{$paperName['p_name']}</h2>
            <div>
                {volist name="ex" id="ex" key='i'}
                    <div class="exam">
                        <h3>{$i}、{$ex['q_name']} </h3>
                        <h4 >你所选择答案<span class="answer">{$ex['s_answer']}</span></br>正确答案<span class="answer">{$ex['q_answer']}</span></h4>
                        <h4>{$ex['A']}</h4>
                        <h4>{$ex['B']}</h4>
                        <h4>{$ex['C']}</h4>
                        <h4>{$ex['D']}</h4>
                        <h4>{$ex['E']}</h4>
                        <h4>{$ex['F']}</h4>
                        <form action="{:url('Answer/note',['q_id' => $ex['q_id']])}" method="post">
                            {if($ex['n_note'])}
                                <p>笔记：{$ex['n_note']}</p>
                            {/if}
                            <input type="hidden" class="{$ex['q_id']}" name="button">
                                <textarea name="noteText" cols="50" rows="1" placeholder="笔记"></textarea>
                            <button name="add"  id={$ex['q_id']} >添加</button>
                            {if($ex['n_note'])}
                            <button id={$ex['q_id']} name="update">修改</button>
                            <button id={$ex['q_id']} name="del"  >删除</button>
                            {/if}
                        </form>
                    </div>
                {/volist}
            </div>
        </div>
        <script>
            $(function(){
                $('button').click(function(){
                    var name =$(this).attr("name");
                    var id = $(this).attr("id");
                    $('.' + id).val(name);
                })
            })
        </script>
    </div>
</body>

</html>